package school30.io;

/**
 * FileConnector - class, which services some filesystem
 * @author asamarin97
 */
public abstract class FileConnector {
    /**
     * Gets file for reading
     * @param path - file path
     * @return FileReader for this file, null if error occurred
     */
    public abstract FileReader openRead(File f);
    /**
     * Gets file for writing
     * @param path - file path
     * @return FileWriter for this file, null if error occurred
     */
    public abstract FileWriter openWrite(File f);
    /**
     * Gets file size
     * @param path - file path
     * @return size of file, -1 if file not exists
     */
    public abstract long size(File f);
    /**
     * Delete file/folder
     * @param path - file/folder path
     */
    public abstract void deleteFile(File f);
    /**
     * Create folder
     * @param path - folder path
     */
    public abstract void createFolder(File f);
    /**
     * Is folder?
     * @param path - folder path
     * @return is folder?
     */
    public abstract boolean isFolder(File f);
    /**
     * Gets folder contents
     * @param path - folder path
     * @return list of paths
     */
    public abstract String[] folderContents(File f);
}
